<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<!DOCTYPE html>
<html lang="en">
<head>
<title><s:message code="app.title" /></title>
<%@ include file="Include.jsp"%>
<script type="text/javascript">
	
	$(document).ready(function() {
		$("#companyname").focus();	
	});
	
</script>
</head>
<body>
	<div class="container">
		<%@ include file="Menu.jsp"%>
		<h2><s:message code="companyForm.addheader" /></h2>
		<hr>
		<form:form id="cancelForm">
		</form:form>
		<form:form class="form-horizontal" method="post" name="companyForm" id="companyForm" commandName="companyForm"
	           modelAttribute="companyForm" >
			
			<table class="table table-bordered">
			<tr>
				<th width="15%"><form:label path="companyname"><s:message code="companyForm.companyname" />
				<font color="red">*</font>
				</form:label>
				</th>
				<td width="*"><form:input path="companyname" cssClass="input-medium" id="companyname" maxlength="40" size="40" tabindex="1" />
				<form:errors cssClass="text-error" path="companyname" />
				</td>
			</tr>
			<tr>
				<th><form:label path="address"><s:message code="companyForm.address" /></form:label></th>
				<td>
					<form:textarea path="address" rows="4" id="address" cssClass="input-xlarge"/>
					<form:errors cssClass="text-error" path="address" />
				</td>
			</tr>
			<tr>
				 <th width="15%"><form:label path="cityId"><s:message code="companyForm.cityName" />
				 <font color="red">*</font>
				 </form:label>
				 </th>
				 <td width="*">
					<form:select path="cityId" cssClass="input-medium" id="cityId" >
						<form:option value="">--SELECT-</form:option>
						<form:options items="${cityList}" itemLabel="cityname" itemValue="cityid"/>
					</form:select>
					<form:errors cssClass="text-error" path="cityId" />
				 </td>
			</tr>
			<tr>
				<th><form:label path="ctcperson"><s:message code="companyForm.ctcperson" />
				<font color="red">*</font>
				</form:label>
				</th>
				<td><form:input path="ctcperson" cssClass="input-xlarge" id="ctcperson" maxlength="50" />
					<form:errors cssClass="text-error" path="ctcperson" />
				</td>
			</tr>
			<tr>
				<th><form:label path="email"><s:message code="companyForm.email" />
				<font color="red">*</font>
				</form:label></th>
				<td><form:input path="email" cssClass="input-xlarge" id="email" maxlength="50" />
					<form:errors cssClass="text-error" path="email" />
				</td>
			</tr>
			<tr>
				<th><form:label path="cellno"><s:message code="companyForm.cellno" /></form:label></th>
				<td><form:input path="cellno" cssClass="input-medium" id="cellno" maxlength="10" size="10" />
					<form:errors cssClass="text-error" path="cellno" />
				</td>
			</tr>
			<tr>
				<th><form:label path="website"><s:message code="companyForm.website" /></form:label></th>
				<td><form:input path="website" cssClass="input-xlarge" id="website" maxlength="50" />
					<form:errors cssClass="text-error" path="website" />
				</td>
			</tr>
			<tr>
				<th><form:label path="comments"><s:message code="companyForm.comments" /></form:label></th>
				<td>
					<form:textarea path="comments" rows="4" id="comments" cssClass="input-xlarge"/>
					<form:errors cssClass="text-error" path="comments" />
				</td>
			</tr>
		</table>
		<br>
			<button class="btn btn-primary" type="submit" formaction="AddCompany"><s:message code="app.add" /></button>
			<button class="btn" type="submit" formaction="ListCompany" form="cancelForm" formmethod="get"><s:message code="app.cancel" /></button>
		</form:form>
		 <%@ include file="Footer.jsp"%>
	</div>
</body>
</html>